<?php
include("../contents.php");
include("../security.php");
include("../settings.php");
include("../database.php");
include("../navigation.php");

if(!empty($_GET["pres"]) && Contents::presence_rights($_GET["pres"])) {
$dirname="./../cache/". $_GET["pres"];
$dir=opendir($dirname);
$success=0;
$error=0;
while (false!==($file=readdir($dir)))
{
	if ($file!="." && $file!=".." && is_file($dirname ."/". $file) && $file!="CVS" && !stristr(".svn", $file))
	{
		if (unlink($dirname ."/". $file))
		{
			$success++;
		}
		else
		{
			$error++;
		}
	}
}
closedir($dir);
?>
<script language="JavaScript" type="text/javascript">
<!--
alert("Es wurden <?php echo $success; ?> Dokumente erfolgreich gel�scht.\nEs traten <?php echo $error; ?> Fehler auf.");
if (document.images)
	self.location.replace("adminleft.php");
else
	self.location.href = ("adminleft.php");
// -->
</script>
<?php
}
?>